package com.yuanchu.goods.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class SpecData implements Serializable {
    private List<SpecList> specList;
    private List<SkuList> skuList;

    @Data
    public static class SpecList implements Serializable {
        private Integer key;
        @JsonProperty("spec_id")
        private Integer specId;
        @JsonProperty("spec_name")
        private String specName;
        private List<ValueList> valueList;

        @Data
        public static class ValueList implements Serializable{
            private Integer key;
            private Integer groupKey;
            @JsonProperty("spec_value")
            private String specValue;
            @JsonProperty("spec_value_id")
            private String specValueId;
        }
    }

    @Data
    public static class SkuList implements Serializable {
        @JsonProperty("image_id")
        private Integer imageId;
        @JsonProperty("goods_price")
        private double goodsPrice;
        @JsonProperty("line_price")
        private double linePrice;
        @JsonProperty("stock_num")
        private Integer stockNum;
        @JsonProperty("goods_weight")
        private double goodsWeight;
        @JsonProperty("goods_sku_no")
        private String goodsSkuNo;
        private String skuKey;
        private List<SkuKeys> skuKeys;
        @JsonProperty("spec_value_0")
        private String specValue0;
        @JsonProperty("spec_value_1")
        private String specValue1;
        @JsonProperty("spec_value_2")
        private String specValue2;

        @Data
        public static class SkuKeys {
            private Integer groupKey;
            private Integer valueKey;
        }
    }
}
